

use "$path\datasets\individual_data.dta", clear



preserve
bysort gkz jahr: keep if _n==1
gen temp=1
bysort jahr: egen sum_cand=sum(temp)
unique gkz
graph bar sum_cand, over(jahr) ytitle(Number of municipalities)  blabel(total, size(medsmall)) ylabel(0 (300) 1600,  angle(horizontal))
graph export Figure3/figure3a.pdf, replace 
restore

preserve
gen temp=1
bysort jahr: egen sum_cand=sum(temp)
gen female_cand=female*temp
bysort jahr: egen sum_fem_cand=sum(female_cand)

graph bar sum_cand sum_fem_cand, over(jahr) ytitle(Number of candidates)  blabel(total, size(medsmall)) legend(label (1 "All") label(2 "Female") ) bargap(3) ylabel(0 (25000) 120000, angle(horizontal) )  
graph export Figure3/figure3b.pdf, replace 
restore








